home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ipchat1a / frmmain.frm next >
Text File  |  1999-10-03  |  12KB  |  377 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form frmMain 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "IP Chat"
  6.    ClientHeight    =   3180
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4380
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   3180
  13.    ScaleWidth      =   4380
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton cmdConnect 
  16.       Caption         =   "Connect"
  17.       Height          =   415
  18.       Left            =   3390
  19.       TabIndex        =   13
  20.       Top             =   2420
  21.       Width           =   975
  22.    End
  23.    Begin MSWinsockLib.Winsock sckConnect 
  24.       Left            =   3480
  25.       Top             =   2760
  26.       _ExtentX        =   741
  27.       _ExtentY        =   741
  28.       _Version        =   393216
  29.    End
  30.    Begin VB.TextBox txtIP 
  31.       Height          =   285
  32.       Left            =   1960
  33.       TabIndex        =   12
  34.       Text            =   "localhost"
  35.       Top             =   2880
  36.       Width           =   1415
  37.    End
  38.    Begin VB.TextBox txtPort 
  39.       Height          =   285
  40.       Left            =   440
  41.       TabIndex        =   10
  42.       Text            =   "400"
  43.       Top             =   2880
  44.       Width           =   1215
  45.    End
  46.    Begin VB.OptionButton optHostGuest 
  47.       Caption         =   "Guest"
  48.       Height          =   195
  49.       Index           =   1
  50.       Left            =   2520
  51.       TabIndex        =   8
  52.       Top             =   2520
  53.       Value           =   -1  'True
  54.       Width           =   735
  55.    End
  56.    Begin VB.OptionButton optHostGuest 
  57.       Caption         =   "Host"
  58.       Height          =   195
  59.       Index           =   0
  60.       Left            =   1800
  61.       TabIndex        =   7
  62.       Top             =   2520
  63.       Width           =   735
  64.    End
  65.    Begin VB.TextBox txtNick 
  66.       Height          =   285
  67.       Left            =   440
  68.       TabIndex        =   6
  69.       Text            =   "NickName"
  70.       Top             =   2460
  71.       Width           =   1215
  72.    End
  73.    Begin VB.CommandButton cmdSend 
  74.       Caption         =   "Send"
  75.       Height          =   300
  76.       Left            =   3600
  77.       TabIndex        =   4
  78.       Top             =   1990
  79.       Width           =   735
  80.    End
  81.    Begin VB.TextBox txtText 
  82.       BeginProperty Font 
  83.          Name            =   "Arial"
  84.          Size            =   9.75
  85.          Charset         =   0
  86.          Weight          =   400
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   300
  92.       Left            =   80
  93.       TabIndex        =   3
  94.       Top             =   1990
  95.       Width           =   3495
  96.    End
  97.    Begin VB.Frame frmeSep 
  98.       Height          =   135
  99.       Left            =   0
  100.       TabIndex        =   2
  101.       Top             =   2280
  102.       Width           =   4385
  103.    End
  104.    Begin VB.TextBox txtChat 
  105.       BeginProperty Font 
  106.          Name            =   "MS Sans Serif"
  107.          Size            =   9.75
  108.          Charset         =   0
  109.          Weight          =   400
  110.          Underline       =   0   'False
  111.          Italic          =   0   'False
  112.          Strikethrough   =   0   'False
  113.       EndProperty
  114.       Height          =   1660
  115.       Left            =   80
  116.       Locked          =   -1  'True
  117.       MultiLine       =   -1  'True
  118.       ScrollBars      =   2  'Vertical
  119.       TabIndex        =   1
  120.       Top             =   190
  121.       Width           =   4215
  122.    End
  123.    Begin VB.Frame frmeChatWindow 
  124.       Caption         =   "Chat Window"
  125.       Height          =   1935
  126.       Left            =   0
  127.       TabIndex        =   0
  128.       Top             =   0
  129.       Width           =   4365
  130.    End
  131.    Begin VB.Shape shpGreen 
  132.       BackColor       =   &H00008000&
  133.       BackStyle       =   1  'Opaque
  134.       BorderColor     =   &H00008000&
  135.       Height          =   255
  136.       Left            =   3960
  137.       Shape           =   3  'Circle
  138.       Top             =   2880
  139.       Width           =   255
  140.    End
  141.    Begin VB.Shape shpRed 
  142.       BackColor       =   &H000000FF&
  143.       BackStyle       =   1  'Opaque
  144.       BorderColor     =   &H000000FF&
  145.       FillColor       =   &H00000080&
  146.       Height          =   255
  147.       Left            =   3480
  148.       Shape           =   3  'Circle
  149.       Top             =   2880
  150.       Width           =   255
  151.    End
  152.    Begin VB.Label lblIP 
  153.       BackStyle       =   0  'Transparent
  154.       Caption         =   "IP:"
  155.       Height          =   255
  156.       Left            =   1710
  157.       TabIndex        =   11
  158.       Top             =   2910
  159.       Width           =   255
  160.    End
  161.    Begin VB.Label lblPort 
  162.       BackStyle       =   0  'Transparent
  163.       Caption         =   "Port:"
  164.       Height          =   255
  165.       Left            =   0
  166.       TabIndex        =   9
  167.       Top             =   2905
  168.       Width           =   375
  169.    End
  170.    Begin VB.Line lneSep3 
  171.       BorderColor     =   &H80000003&
  172.       Index           =   1
  173.       X1              =   3350
  174.       X2              =   3350
  175.       Y1              =   2400
  176.       Y2              =   2810
  177.    End
  178.    Begin VB.Line lneSep3 
  179.       BorderColor     =   &H00FFFFFF&
  180.       Index           =   0
  181.       X1              =   3360
  182.       X2              =   3360
  183.       Y1              =   2400
  184.       Y2              =   2820
  185.    End
  186.    Begin VB.Line lneSep2 
  187.       BorderColor     =   &H80000003&
  188.       Index           =   1
  189.       X1              =   1680
  190.       X2              =   1680
  191.       Y1              =   2790
  192.       Y2              =   2390
  193.    End
  194.    Begin VB.Line lneSep 
  195.       BorderColor     =   &H80000003&
  196.       Index           =   1
  197.       X1              =   0
  198.       X2              =   3360
  199.       Y1              =   2790
  200.       Y2              =   2790
  201.    End
  202.    Begin VB.Line lneSep2 
  203.       BorderColor     =   &H00FFFFFF&
  204.       Index           =   0
  205.       X1              =   1690
  206.       X2              =   1690
  207.       Y1              =   2805
  208.       Y2              =   2400
  209.    End
  210.    Begin VB.Line lneSep 
  211.       BorderColor     =   &H00FFFFFF&
  212.       Index           =   0
  213.       X1              =   0
  214.       X2              =   3360
  215.       Y1              =   2805
  216.       Y2              =   2805
  217.    End
  218.    Begin VB.Label lblNick 
  219.       BackStyle       =   0  'Transparent
  220.       Caption         =   "Nick: "
  221.       Height          =   255
  222.       Left            =   0
  223.       TabIndex        =   5
  224.       Top             =   2490
  225.       Width           =   495
  226.    End
  227. End
  228. Attribute VB_Name = "frmMain"
  229. Attribute VB_GlobalNameSpace = False
  230. Attribute VB_Creatable = False
  231. Attribute VB_PredeclaredId = True
  232. Attribute VB_Exposed = False
  233. '**********************************************************
  234. '*               IP Chat by Joseph Huntley                *
  235. '*               joseph_huntley@email.com                 *
  236. '*                http://joseph.vr9.com                   *
  237. '*                                                        *
  238. '*  Made:  October 4, 1999                                *
  239. '*  Level: Intermediate                                   *
  240. '**********************************************************
  241. '* Notes: None                                            *
  242. '**********************************************************
  243.  
  244. Private Const vbDarkRed = &H80&
  245. Private Const vbDarkGreen = &H8000&
  246.  
  247.  
  248. Private Sub cmdSend_Click()
  249.   ''Send text to other person and print it into our textbox
  250.   sckConnect.SendData txtNick.Text & ":" & vbTab & txtText.Text
  251.   txtChat.Text = txtChat.Text & txtNick.Text & ":" & vbTab & txtText.Text & vbCrLf
  252.   ''clear textbox
  253.   txtText.Text = ""
  254.   ''show bottom half of textbox
  255.   txtChat.SelStart = Len(txtChat.ytext)
  256.   txtChat.SelLength = 0
  257. End Sub
  258.  
  259. Private Sub sckConnect_Close()
  260.    cmdConnect_Click 'Reset everything
  261. End Sub
  262.  
  263. Private Sub sckConnect_Connect()
  264.    txtChat.Text = txtCha